<!DOCTYPE HTML>
<title>Canvas test: 2d.state.saverestore.stackdepth</title>
<!--[if IE]><script src="../excanvas/excanvas.js"></script><![endif]-->
<script src="../tests.js"></script>
<link rel="stylesheet" href="../tests.css">
<link rel="prev" href="2d.state.saverestore.stack.html" title="2d.state.saverestore.stack">
<link rel="next" href="2d.state.saverestore.underflow.html" title="2d.state.saverestore.underflow">
<body class="show_output">
<p>
 <a href="2d.state.saverestore.stack.html" accesskey="p" title="[p] 2d.state.saverestore.stack">&lt;</a>
 <a href="index.html">[index]</a>
 <a href="2d.state.saverestore.underflow.html" accesskey="n" title="[n] 2d.state.saverestore.underflow">&gt;</a>
<h1><a href="index.2d.html">2d</a>.<a href="index.2d.state.html">state</a>.<a href="index.2d.state.saverestore.html">saverestore</a>.stackdepth</h1>
<p class="desc">save()/restore() stack depth is not unreasonably limited</p>
<div class="refs">References:
<ul>
<li><a href="spec.html#testrefs.2d.state.save">2d.state.save</a>
<li><a href="spec.html#testrefs.2d.state.restore">2d.state.restore</a>

</ul>
</div>

<p class="output">Actual output:</p>
<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>

<ul id="d"></ul>
<script>
_addTest(function(canvas, ctx) {

var limit = 512;
for (var i = 1; i < limit; ++i)
{
    ctx.save();
    ctx.lineWidth = i;
}
for (var i = limit-1; i > 0; --i)
{
    _assertEqual(ctx.lineWidth, i, "ctx.lineWidth", "i");
    ctx.restore();
}


});
</script>

